package cn.wetcland.urban.admin.controller;

import cn.wetcland.urban.admin.service.UtDistrictService;
import cn.wetcland.urban.common.AjaxResponse;
import cn.wetcland.urban.generator.domain.UtDistrict;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/district")
public class DistrictController {

    @Resource
    public UtDistrictService districtService;

    @GetMapping("searchCity")
    public AjaxResponse searchCity(String cityName) {
        List<UtDistrict> list = districtService.searchCity(cityName);
        return AjaxResponse.success(list);
    }

}
